package com.uton.mvp_demo.presenter;

import com.uton.mvp_demo.model.ICallback;
import com.uton.mvp_demo.model.WeatherModel;

/**
 * Created by jackwang on 2018/4/8.
 */

public class MainActivityPresenter extends AbsPresenter<WeatherModel> {

    public MainActivityPresenter() {
        setModel(new WeatherModel());
    }

    public void showWeather() {
        getController()
                .showLoading()
                .getModel()
                .getData(new ICallback() {
                    @Override
                    public void action(Object... args) {
                        getController()
                                .showPaintedEggshell((String) args[0])
                                .getController()
                                .dismissLoading();
                    }
                });
    }
}
